package com.w.wx.mapper;


import com.w.wx.domain.DTO.GoodsDeDTO;
import com.w.wx.domain.Goods;
import com.w.wx.domain.UserEr;


import org.mapstruct.Mapper;

import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface DTOMapper {


    @Mappings({
            @Mapping(source = "good.gid",target = "gid"),
            @Mapping(source = "good.goodsName",target = "goodsName"),
            @Mapping(source = "good.goodsTitle",target = "goodsTitle"),
            @Mapping(source = "good.goodsPriceNew",target = "goodsPriceNew"),
            @Mapping(source = "good.goodsPriceOld",target = "goodsPriceOld"),
            @Mapping(source = "good.goodsXueyuan",target = "goodsXueyuan"),
            @Mapping(source = "good.goodsDec",target = "goodsDec"),
            @Mapping(source = "good.openSum",target = "openSum"),
            @Mapping(source = "good.likeSum",target = "likeSum"),
            @Mapping(source = "likeState",target = "likeState"),
            @Mapping(source = "good.imageUrl",target = "imageUrl"),
            @Mapping(source = "good.issueTime",target = "issueTime"),
            @Mapping(source = "userEr.openid",target = "openid"),
            @Mapping(source = "userEr.wxname",target = "wxname"),
            @Mapping(source = "userEr.state",target = "imageCheckStatus")
    })
    GoodsDeDTO from(Goods good, UserEr userEr,Integer likeState);



}
